import org.apache.shiro.codec.Base64;

/**
 * @author 空白
 * @version 1.0
 * Create by 2019/08/23 11:31
 */
public class testBase64 {
    public static void main(String[] args) {
        String str = "123456";
        String s = "";
        System.out.println("~~~~"+str.length());
        for (int i = 0; i < (6-str.length()); i ++) {
            s += "0";
        }
        str = s + str;
        System.out.println(str);
        String base64Encoded = Base64.encodeToString(str.getBytes());
        String str2 = Base64.decodeToString(base64Encoded);
        System.out.println("text ===== " + str);
        System.out.println("encrptText ===== " + base64Encoded);
        System.out.println("text2 ===== " + str2);
        int i = 0;
        for ( ; i < 6; i ++) {
            if (str.charAt(i) != '0') {
                break;
            }
        }
        System.out.println(" i ======" + i);
        System.out.println(str.substring(i));
    }
}
